package com.rainbow.micro.example.config;

import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.boot.actuate.info.Info;
import org.springframework.boot.actuate.info.InfoContributor;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author rainbow
 * springBootAdmin监控信息
 */
@Component
public class InfoConfig implements InfoContributor {
    @Override
    public void contribute(Info.Builder builder) {
        builder.withDetail("start time", DateFormatUtils.format(new Date(),"YYYY-MM-dd HH:mm:ss"));
        Map infoMap=new HashMap();
        builder.withDetails(infoMap);
    }
}
